/**
 * 
 */
package fr.fermeManager.library.dao;

import java.util.ArrayList;
import java.util.List;

import fr.fermeManager.library.model.beans.Transaction;
import fr.fermeManager.library.model.beans.TypeTransaction;

/**
 * @author Mo
 *
 */
public class DaoTransactionImpl implements DaoTransaction {
	
	private int cpt = 8;

	public List<Transaction> getFermeTransactions(int idFerme) {
		
		TypeTransaction typeTransac1 = new TypeTransaction(true);
		typeTransac1.setId(1);
		
		TypeTransaction typeTransac7 = new TypeTransaction(true);
		typeTransac7.setId(7);
		
		TypeTransaction typeTransac4 = new TypeTransaction(true);
		typeTransac7.setId(4);

		Transaction transaction1 = new Transaction();
		transaction1.setActif(true);
		transaction1.setDescritption("Transaction desc 111111111");
		transaction1.setId(1);
		transaction1.setLibelle("Trans 11");
		transaction1.setMontant(1111);
		transaction1.setTypeTransaction(typeTransac1);
		
		Transaction transaction2 = new Transaction();
		transaction2.setActif(true);
		transaction2.setDescritption("Transaction desc 222222222");
		transaction2.setId(2);
		transaction2.setLibelle("Trans 22");
		transaction2.setMontant(2222);
		transaction2.setTypeTransaction(typeTransac1);
		
		
		Transaction transaction3 = new Transaction();
		transaction3.setActif(true);
		transaction3.setDescritption("Transaction desc 333333333");
		transaction3.setId(3);
		transaction3.setLibelle("Trans 33");
		transaction3.setMontant(3333);
		transaction3.setTypeTransaction(typeTransac1);
		
		
		
		Transaction transaction4 = new Transaction();
		transaction4.setActif(true);
		transaction4.setDescritption("Transaction desc 444444444");
		transaction4.setId(4);
		transaction4.setLibelle("Trans 44");
		transaction4.setMontant(4444);
		transaction4.setTypeTransaction(typeTransac4);
		
		Transaction transaction5 = new Transaction();
		transaction5.setActif(true);
		transaction5.setDescritption("Transaction desc 555555555");
		transaction5.setId(5);
		transaction5.setLibelle("Trans 55");
		transaction5.setMontant(5555);
		transaction5.setTypeTransaction(typeTransac4);
		
		Transaction transaction6 = new Transaction();
		transaction6.setActif(true);
		transaction6.setDescritption("Transaction desc 666666666");
		transaction6.setId(6);
		transaction6.setLibelle("Trans 66");
		transaction6.setMontant(6666);
		transaction6.setTypeTransaction(typeTransac7);
		
		Transaction transaction7 = new Transaction();
		transaction7.setActif(true);
		transaction7.setDescritption("Transaction desc 777777777");
		transaction7.setId(7);
		transaction7.setLibelle("Trans 77");
		transaction7.setMontant(7777);
		transaction7.setTypeTransaction(typeTransac7);
		
		List<Transaction> listeTmp = new ArrayList<Transaction>();
		
		listeTmp.add(transaction1);
		listeTmp.add(transaction2);
		listeTmp.add(transaction3);
		listeTmp.add(transaction4);
		listeTmp.add(transaction5);
		listeTmp.add(transaction6);
		//listeTmp.add(transaction7);
		
		return listeTmp;
	}

	public Transaction ajouterTransaction(int idFerme, Transaction nouveauTransac) {
		nouveauTransac.setId(cpt);
		cpt++;
		return nouveauTransac;
	}

	public void supprimerTransaction(int idTransaction) {
		// TODO Auto-generated method stub
		
	}

	public void modifierTransaction(Transaction transacParam) {
		// TODO Auto-generated method stub
		
	}

}
